﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace park.Equipment
{
    public partial class InspectionTerminalAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            string no = this.txtNo.Text;
            string code = this.txtCode.Text;
            string model = this.txtModel.Text;
            string empCode = this.txtEmpNo.Text;
            DateTime date = string.IsNullOrEmpty(this.txtDate.Text) ? DateTime.Parse("1900-01-01") : DateTime.Parse(this.txtDate.Text);
            string description = this.txtDescription.Text;
            string connection = this.txtConnection.Text;

            cn.linkit.epark.ServiceList sl = new cn.linkit.epark.ServiceList();
            bool flag = sl.AddInspectionTerminal(no, code, model, empCode, date, description, connection);       

            if (flag)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "<script>alert('数据保存成功！');</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "<script>alert('数据保存失败，请重试 ...');</script>");
            }
        }
    }
}